<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>t_sndreldata</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4>NAME</h4><blockquote>
t_sndreldata - initiate/respond to an orderly release with user data
<xref type="10" name="sndreldata"></xref>
</blockquote><h4>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="xti.h.html">xti.h</a>&gt;

int t_sndreldata(
    int fd,
    struct t_discon *discon)
</code>
</pre>
</blockquote><h4>DESCRIPTION</h4><blockquote>
<pre>
<P><table  bordercolor=#000000 border=1 align=center><tr valign=top><th align=center><b>Parameters</b>
<th align=center><b>Before call</b>
<th align=center><b>After call</b>
<tr valign=top><td align=left>fd
<td align=center>x
<td align=center>/
<tr valign=top><td align=left>discon-&gt
<td align=center>udata.maxlen
<td align=center>/
<tr valign=top><td align=left>discon-&gt
<td align=center>udata.len
<td align=center>x
<tr valign=top><td align=left>discon-&gt
<td align=center>udata.buf
<td align=center>?(?)
<tr valign=top><td align=left>discon-&gt
<td align=center>reason
<td align=center>?
<tr valign=top><td align=left>discon-&gt
<td align=center>sequence
<td align=center>/
</table>
</pre>
<p>
This function is used to initiate an orderly release of the outgoing
direction of data transfer
and to send
user data with the release.  The argument 
<I>fd</I>
identifies the local transport endpoint where the connection
exists, and 
<I>discon</I>
points to a 
<B>t_discon</B>
structure containing the following members:
<pre>
<code>
struct netbuf udata;
int reason;
int sequence;
</code>
</pre>
<p>
After calling 
<i>t_sndreldata()</i>,
the user may not send any
more data over the connection.  However, a user may
continue to receive data if an orderly release
indication has not been received.
<p>
The field 
<I>reason</I>
specifies the reason for the
disconnection through a protocol-dependent 
<I>reason code</I>,
and 
<I>udata</I>
identifies any user data that is sent with the
disconnection; the field 
<I>sequence</I>
is not used.
<p>
The 
<I>udata</I>
structure specifies the user data to be sent
to the remote user.  The amount of user data must not
exceed the limits supported by the transport provider,
as returned in the 
<I>discon</I>
field of the 
<I>info</I>
argument of
<i><a href="t_open.html">t_open()</a></i>
or 
<i><a href="t_getinfo.html">t_getinfo()</a></i>.
If the 
<I>len</I>
field of 
<I>udata</I>
is zero or if the provider did not return T_ORDRELDATA in the 
<i><a href="t_open.html">t_open()</a></i>
flags, no data will be sent to the remote user.
<p>
If a user does not wish to send data and reason code to
the remote user, the value of 
<I>discon</I>
may be a null pointer.
<p>
This function is an optional service of the transport
provider, only supported by providers of service type
T_COTS_ORD. The flag T_ORDRELDATA in the 
<I>info-&gt;flag</I>
field returned by 
<i><a href="t_open.html">t_open()</a></i>
or 
<i><a href="t_getinfo.html">t_getinfo()</a></i>
indicates that the provider
supports orderly release user data; when the flag is not set,
this function behaves as 
<i><a href="t_rcvrel.html">t_rcvrel()</a></i>
and no user data is returned.
<p>
This function may not be available on all systems.
</blockquote><h4>VALID STATES</h4><blockquote>
T_DATAXFER, T_INREL
<br>
</blockquote><h4>ERRORS</h4><blockquote>
On failure, 
<I>t_errno</I>
is set to one of the following:
<dl compact>

<dt>[TBADDATA]<dd>The amount of user data specified was
not within the bounds allowed by the
transport provider, or user data was
supplied and the provider did not
return T_ORDRELDATA in the 
<i><a href="t_open.html">t_open()</a></i>
flags.

<dt>[TBADF]<dd>The specified file descriptor does not refer to a transport endpoint.

<dt>[TFLOW]<dd>O_NONBLOCK was set, but the flow
control mechanism prevented the
transport provider from accepting the
function at this time.

<dt>[TLOOK]<dd>An asynchronous event has occurred on this
transport endpoint and requires immediate
attention.

<dt>[TNOTSUPPORT]<dd>Orderly release is not supported by the
underlying transport provider.

<dt>[TOUTSTATE]<dd>The communications endpoint referenced by
<I>fd</I>
is not in one of the states in which a call to this function is valid.

<dt>[TPROTO]<dd>This error indicates that a
communication problem has been detected
between XTI and the transport provider
for which there is no other suitable
XTI error
<I>(t_errno)</I>.

<dt>[TSYSERR]<dd>A system error has occurred during execution
of this function.

</dl>
</blockquote><h4>RETURN VALUE</h4><blockquote>
Upon successful completion, a value of 0 is returned.
Otherwise, a value of -1 is returned and 
<I>t_errno</I>
is set to indicate an error.
</blockquote><h4>SEE ALSO</h4><blockquote>
<i><a href="t_getinfo.html">t_getinfo()</a></i>,
<i><a href="t_open.html">t_open()</a></i>,
<i><a href="t_rcvreldata.html">t_rcvreldata()</a></i>,
<i><a href="t_rcvrel.html">t_rcvrel()</a></i>,
<i><a href="t_sndrel.html">t_sndrel()</a></i>.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
